import 'package:azlistview_plus/azlistview_plus.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/ui/az_list/controller.dart';

class AzListPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetX<AzListController>(
        init: AzListController(),
        builder: (controller) {
          return Scaffold(
              appBar: AppBar(
                title: Text('选择城市'),
              ),
              body: AzListView(
                data: controller.cityList,
                itemCount: controller.cityList.length,
                padding: EdgeInsets.symmetric(horizontal: 15),
                itemBuilder: (BuildContext context, int index) {
                  final item = controller.cityList[index];
                  return Container(height: 40, child: Text(item.name));
                },
                // itemBuilder: (BuildContext context, int index) {},
              ));
        });
  }
}
